package com.heima.article.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.heima.model.article.dtos.ApArticleCommentDto;

import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import com.heima.model.article.dtos.ArticleHomeDto;
import com.heima.model.article.pojos.ApArticle;
import com.heima.model.article.vos.ArticleCommnetVo;
import com.heima.model.common.dtos.ResponseResult;
import com.heima.model.article.vos.ApArticleVo;
import com.heima.model.wemedia.dtos.CommentPageDto;
import com.heima.model.article.vos.CommentArticleVo;
import com.heima.model.wemedia.dtos.ManageDto;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import java.util.Date;
import java.util.List;
import java.util.Map;

@Mapper
public interface ApArticleMapper extends BaseMapper<ApArticle> {
    
    /**
     * @Description: 加载APP端的文章
     * @Param: 
     * @return: java.util.List<com.heima.model.article.pojos.ApArticle>
     * @Author: tyz
     * @Date: 2023/6/5 
     */
    List<ApArticle> loadArticleList(@Param("dto") ArticleHomeDto dto,
                                    @Param("type") short type);

    List<ApArticle> findArticleListByLast5days(Date date);


    List<ArticleCommnetVo> findArticleComment(@Param("dto")ApArticleCommentDto dto);

    Integer findTotal(@Param("dto")ApArticleCommentDto dto);


    IPage<CommentArticleVo> pageCommentArticle(@Param(value = "page") Page<CommentArticleVo> page, @Param(value = "dto") ManageDto dto);

    Map queryLikesAndConllections(Integer wmUserId, Date beginDate, Date endDate);

    IPage<ApArticleVo> commentPageInf(@Param("page") IPage<ApArticleVo> page, @Param("dto")CommentPageDto dto);
}
